﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using System.Windows.Data;
using System.Globalization;
using DevExpress.Xpf.LayoutControl;
using TimeTableManageSilverlight.ViewModel;

namespace TimeTableManageSilverlight.View
{
    public partial class MainForm : Page
    {
         //public MainFormViewModel ViewModel;
        public MainForm()
        {
            //ViewModel = new MainFormViewModel();
            InitializeComponent();
            //this.Loaded += (s, e) => { this.DataContext = ViewModel; };
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {

        }

        private void tile1_Click(object sender, EventArgs e)
        {

        }

        private void tileLayoutControl1_TileClick(object sender, TileClickEventArgs e)
        {

        }
        
    }
    public class StringCollection : List<string> { }

    public class TimeSpanToSecondsConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return ((TimeSpan)value).TotalSeconds;
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return TimeSpan.FromSeconds((double)value);
        }
    }

    public class ScalablePaddingConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            //var controlHeight = (double)value;
            //double desiredContentHeight = 3 * Tile.LargeHeight + 2 * TileLayoutControl.DefaultItemSpace + 20;  // scroll bar height
            //double paddingY = Math.Floor(Math.Max(0, controlHeight - desiredContentHeight) / 2);
            //paddingY = Math.Max(MinPadding, Math.Min(paddingY, TileLayoutControl.DefaultPadding.Top));
            //double relativePadding = (paddingY - MinPadding) / (TileLayoutControl.DefaultPadding.Top - MinPadding);
            //double paddingX = Math.Floor(MinPadding + relativePadding * (TileLayoutControl.DefaultPadding.Left - MinPadding));
            return 8;
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

    } 
}
